<?php
/**
 * Page to Admin class
 *
 * @package eesc
 */ 

/**
 * Require rules
 */
require_once BASE_URI . '/lib/Student.class.php';

/**
 * Class for admin maniputation things
 *
 * @package eesc
 * @subpackage classes
 */
class Admin {
	private $db;
	
	/**
	 * Constructor
	 */
	public function __construct() {
		$this->db = new Database();
		$this->db->connect();
	}
	
	/**
	 * Collect a list of all the students
	 * @return string $data
	 */
	public function getAllStudents() {
		$data = $this->db->select("Student","USN");
		return $data;
	}
	
	/**
	 * Collect a list of all the students details
	 * @return string $data
	 */
	public function getAllStudentDetails() {
		$data = array();
		foreach ($this->getAllStudents() as $studentUSN) {
			$student = new Student($studentUSN['USN']);
			$data[] = $student->getDetails();
		}
		return $data;
	}
}
?>
